Device for controlling an amount of light of a lighting unit for an endoscope

ABSTRACT

A device for controlling an amount of light of a lighting unit for use in an endoscope that is used to view an image of an object. A light shielding system shields light generated by a light source and transmitted to the endoscope and a stepping motor drives the light shielding system for a plurality of predetermined time intervals. A system detects a brightness of the image during each of the plurality of predetermined time intervals and an input system inputs one of a plurality of desired brightnesses of the image. A generating system generates a predetermined number of pulses during each of the plurality of predetermined time intervals, the predetermined number of pulses being transmitted to the stepping motor and a system determines an angular position of the light shielding system. A setting system sets one of a plurality of allowed brightness ranges of the image in response to the determined angular position of the light shielding system and a system determines whether the detected brightness is within the set one of the plurality of allowed brightness ranges.

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application is a Divisional of U.S. application Ser. No.09/256,230, filed Feb. 24, 1999, which is a Divisional of U.S.application Ser. No. 08/917,083, filed Aug. 25, 1997, which is aDivisional application of U.S. application Ser. No. 08/512,399, filedAug. 8, 1995, the contents of which are herein incorporated by referencein its entirety.

BACKGROUND OF THE INVENTION

[0002] The present invention is related to an device for controlling anamount of light transmitted from a light source of a video processorwhich functions as lighting unit for an endoscope.

[0003] In an endoscope, light is transmitted from a light source usinglight wave guide, such as an optical fiber cable, in order to illuminatean object to be observed. In order to adjust the brightness of theobserved image, a device for controlling an amount of light transmittedfrom a light source to an incident surface of the light wave guide, isemployed. In a conventional endoscope, the light amount controllingdevice has a light shield which is rotated about an axis by a steppingmotor. The rotation of the light shield controls the amount of lightfrom the light source that is incident on the incident surface of theoptical fiber cable. With this type of light amount controlling device,the brightness of the observed image is detected periodically. Then, theposition of the light shield is adjusted such that the brightness of theobserved image is within an allowed brightness range.

[0004] Conventionally, the amount of light transmitted from the lightsource to the endoscope is controlled by applying the same number ofpulses to the input of the stepping motor during each interruptprocedure (see FIG. 11A). Therefore, the stepping motor and the lightshield are rotated by the same angular amount during each interruptprocedure. The process of detecting the brightness level, and drivingthe stepping motor to rotate the light shield is repeated until thedetected brightness is again within the allowed brightness range.

[0005] However, in the conventional endoscope, since the number ofdriving pulses sent to the motor is constant during the execution ofeach interrupt procedure, if the number of pulses is set to a relativelysmall value, thee the light shield will be moved slowly. This results inan increase in the response time of the light amount controlling device.

[0006] As shown in FIG. 1A, for example, each drive pulse rotates themotor 0.5 degrees, three drive pulses are sent during each interrupt,and the interrupts are executed every 50 ms. Thus, in order to rotatethe stepping motor 10 degrees, seven interruption procedures arerequired for a total time of 0.35 seconds. Further, since the number ofpulses must be in multiples of three, the number of drive pulses cannotbe 20, the optimum number, but must be 18 or 21. Therefore, the lightshield cannot be moved to the optimum position.

[0007] In order to decrease the response time of the light amountcontrolling device, the number of driving pulses sent to the steppingmotor can be increased. However, in this case, the light shield will bemoved through a large angle of rotation and thus it may not be possibleto adjust the amount of light such that the brightness level fallswithin the allowed brightness range. This will result in the controlsystem becoming unstable with unwanted back-and-forth oscillations(hereinafter referred to as hunting) occurring.

[0008] Further, as different types of endoscopes have different allowedbrightness ranges, different numbers of driving pulses are required inorder to properly adjust the amount of light transmitted from the lightsource.

[0009] Furthermore, for one type of endoscope, if the sending of apredetermined number of pulses to the stepping motor does not causehunting, in another endoscope, the predetermined number of pulses maynot be sufficiently low, and hunting may occur. Therefore, since thelight source may be connected with various types of endoscopes, thenumber of pulses may be set to-the minimum number required for all typesof endoscopes in order to avoid the hunting problem. As a result, thespeed at which the brightness level can be adjusted for the types ofendoscopes where hunting is not a problem, will be reduced.

SUMMARY OF THE INVENTION

[0010] It is therefore an object of the present invention to provide adevice for controlling an amount of light of a lighting unit for anendoscope, in which the amount of light can be adjusted quickly, andaccurately, and hunting can be prevented.

[0011] According to one aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor an endoscope, the endoscope being used to view an image of anobject. The device includes means for shielding light, generated by alight source and transmitted to the endoscope, a stepping motor fordriving the light shielding means, the stepping motor driving the lightshielding means for a plurality of predetermined time intervals, andmeans for detecting a brightness of the image, the brightness of theimage being detected during each of the predetermined time intervals.Pulses are generated during each of the predetermined time intervals, anumber of the pulses generated being used to control an amount ofdriving of the stepping motor in each of the plurality of predeterminedtime intervals. The number of pulses generated by the pulse generatingmeans is determined in accordance with a difference between thebrightness of the image detected during each of the predetermined timeintervals and a desired brightness of the image.

[0012] Therefore, a different number of pulses is generated when thedifference in brightness of the detected image and the desiredbrightness changes. Preferably, when the brightness difference is largea large number of pulses is generated, and therefore the light shieldingmeans is moved quickly. Then when the brightness difference is small,and the detected brightness is almost within an allowed brightnessrange, the number of pulses generated is small. Therefore, the lightshielding means is moved in smaller steps and hunting can be prevented.

[0013] In a preferred embodiment, there is a memory for storing a firsttable of numbers of pulses to be generated corresponding to a pluralityof brightness ranges, each of the brightness ranges being a range ofdifferences between the detected brightness of the image and the desiredbrightness of the image. The memory can be a ROM or other static memory.Further, there is a unique number of pulses stored for each brightnessrange. Therefore, depending on the difference in brightness between thedetected image and an input brightness level set by an operator, thenumber of pulses sent to the stepping motor will be different.

[0014] Since, many types of endoscopes may be used with the lightingunit, the memory of the preferred embodiment stores a second table ofnumbers of pulses to be generated corresponding to the plurality ofbrightness ranges. The second table of numbers of pulses is differentfrom the first table of numbers of pulses, and corresponds to anothertype of endoscope.

[0015] Further, the device includes a selector for selecting one of thefirst table of numbers of pulses and the second table of numbers ofpulses.

[0016] In one preferred embodiment, the endoscope has a memory forstoring the type of the endoscope. The selector selects one of the firsttable and the second table in response to the type of the endoscopestored in the memory.

[0017] This allows for easy selectability of the endoscope andfacilitates operation of the device when used with the respectiveendoscope. Furthermore, the device is optimized for each endoscope thatis attached thereto.

[0018] In another preferred embodiment, the selector is manuallyactuable for selecting the type of endoscope.

[0019] According to a second aspect of the present invention, there isprovided a device for controlling a device for controlling an amount oflight of a lighting unit for an endoscope, the endoscope being used toview an image of an object. The device includes means for shieldinglight, generated by a light source and transmitted to the endoscope, astepping motor for driving the light shielding means, the stepping motordriving the light shielding means by a predetermined driving amount fora plurality of time intervals, and means for setting a duration of thetime interval to have one of a plurality of time values.

[0020] Therefore, by changing the time interval for driving the lightshielding means, the time required for adjusting the amount of light canbe reduced, even if the amount of driving of the stepping motor is madesmall in order to prevent hunting.

[0021] In a preferred embodiment, the endoscope type is stored in amemory and the duration of the time interval is set in accordance withthe type of the endoscope. Therefore, the operation of the device can beoptimized for each type of endoscope.

[0022] In another preferred embodiment, the time interval is set inaccordance with the position of a manually operable switch. This addsflexibility to the operation of the device, and allows operation to beoptimized for endoscopes that do not have the type stored in a memory.

[0023] According to a third aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor an endoscope, the endoscope being used to view an image of anobject. The device includes means for shielding light, generated by alight source and transmitted to the endoscope, a stepping motor fordriving the light shielding means, the stepping motor driving the lightshielding means for a plurality of predetermined time intervals, andmeans for detecting a brightness of the image, the brightness of theimage being detected during each of the predetermined time intervals. Apredetermined number of pulses is generated during each of thepredetermined time intervals, the predetermined number of pulses beingtransmitted to the stepping motor during each of the predetermined timeintervals. An angular position of the light shielding means isdetermined, and a phase of excitation of the stepping motor is varied inresponse to the determined angular position.

[0024] Therefore, by changing the number of phases of excitation of thestepping motor, the drive amount of the stepping motor in a givenpredetermined time interval can be changed.

[0025] In a preferred embodiment the stepping motor is driven with 2phase excitation when the angular position is less than or equal to apredetermined angular position. Otherwise, the stepping motor is drivenwith 1-2 phase excitation (i.e., excitation alternating between singlephase and two phase excitation at every pulse).

[0026] In another preferred embodiment, the phase of excitation of thestepping motor is further varied in response to the detected brightnessof the image. In this case, even if the angular position is greater thanthe predetermined angular position, if the brightness of the image islarger than a predetermined value, the stepping motor is driven with 2phase excitation, in order to improve the speed at which the amount oflight is reduced in order to bring the detected image brightness into anallowed brightness range.

[0027] In another preferred embodiment, the phase of excitation of thestepping motor is varied in response to the endoscope type. Thisoptimizes the performance of the device for each type of endoscope.

[0028] According to a fourth aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor an endoscope, the endoscope being used to view an image of anobject. The device includes means for shielding light, generated by alight source and transmitted to the endoscope, a stepping motor fordriving the light shielding means, the stepping motor driving the lightshielding means for a plurality of predetermined time intervals, meansfor detecting a brightness of the image, the brightness of the imagebeing detected during each of the predetermined time intervals, andmeans for inputting one of a plurality of desired brightnesses of theimage. A predetermined number of pulses is generated during each of thepredetermined time intervals, the predetermined number of pulses beingtransmitted to the stepping motor. One of a plurality of allowedbrightness ranges of the image is set in accordance with the inputdesired brightness of the image. Then, the device determines whether thedetected brightness is within the set allowed brightness range.

[0029] Therefore, in a preferred embodiment, when the desired inputbrightness of the image is high, the allowed brightness range is large,since the change in brightness of the image per unit rotation of thelight shielding means is small, and therefore, the number of timeintervals required to adjust the amount of light such that the detectedimage brightness is within the allowed brightness range, is reduced.

[0030] In another preferred embodiment, an angular position of the lightshielding means is determined, and the allowed brightness range is setin response to the determined angular position of the light shieldingmeans.

[0031] In yet another preferred embodiment the type of endoscope isdetermined and the allowed brightness range is also set in response tothe determined endoscope type.

[0032] According to a fifth aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor an endoscope, the endoscope being used to view an image of anobject. The device including means for shielding light, generated by alight source and transmitted to the endoscope, a stepping motor fordriving the light shielding means, the stepping motor driving the lightshielding means for a plurality of predetermined time intervals, meansfor detecting a brightness of the image, the brightness of the imagebeing detected during each of the predetermined time intervals, meansfor inputting a desired brightness of the image. Pulses are generatedduring each of the predetermined time intervals, a number of the pulsesgenerated being used to control an amount of driving of the steppingmotor in each of the plurality of predetermined time intervals. Thenumber of pulses generated by the pulse generating means is determinedin accordance with the input desired brightness of the image.

[0033] Therefore, since the change in brightness per unit rotation ofthe light shielding means increases as the brightness of the imagedecreases, when the input brightness level is high, the light shieldingmeans can have a higher driving amount than when the brightness of theimage is low. This will improve the speed at which the amount of lightcan be adjusted, without introducing a hunting problem.

[0034] Alternatively, the number of pulses generated can be determinedin accordance with an angular position of the light shielding means.

[0035] Optionally, the number of pulses generated can be furtherdetermined in accordance with the type of endoscope.

[0036] According to a sixth aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor an endoscope, the endoscope being used to view an image of anobject. The device includes means for shielding light, generated by alight source and transmitted to the endoscope, a stepping motor fordriving the light shielding means, the stepping motor driving the lightshielding means for a plurality of predetermined time intervals, meansfor detecting a brightness of the image, the brightness of the imagebeing detected during each of the predetermined time intervals, andmeans for detecting hunting of the stepping motor. Pulses are generatedduring each of the predetermined time intervals, a number of the pulsesgenerated being used to control an amount of driving of the steppingmotor in each of the plurality of predetermined time intervals. A numberof pulses generated by the pulse generating means during each of thepredetermined time intervals is determined in response to hunting beingdetected by the hunting detecting means, the determined number of pulsesbeing reduced when the hunting is detected.

[0037] Therefore, in case hunting is detected, by reducing the number ofpulses sent to the stepping motor, the driving amount of the steppingmotor is reduced, and the hunting problem can be overcome.

[0038] Optionally, the device determines whether the brightness of theimage is larger than a desired brightness of the image, and outputs afirst value if the detected brightness is larger than the desiredbrightness, and outputs a second value if the detected brightness is notlarger than the desired brightness. Each output value is stored in aregister of a memory. The device then determines if hunting occurred byexamining the registers of the memory. If the registers sequentiallystore an alternating pattern of the first and second values, thenhunting is occurring.

[0039] By using a memory to store the information, the detection thathunting is occurring can be done more quickly, since the response timeof the stepping motor does not effect the detection of hunting.

[0040] Alternatively, data related to a direction (i.e., forward andreverse) of driving the stepping motor can be stored in a register ofanother memory. If the registers sequentially store an alternatingpattern of the forward and reverse data, then hunting is occurring.

[0041] According to a seventh aspect of the present invention, there isprovided a device for controlling an amount of light of a lighting unitfor an endoscope, the endoscope being used to view an image of anobject. The device includes a plurality of light shields for shieldinglight generated by a light source and transmitted to the endoscope, astepping motor for driving the plurality light shield means, thestepping motor driving the plurality of light shields for a plurality ofpredetermined time intervals, means for detecting a brightness of theimage, the brightness of the image being detected during each of thepredetermined time intervals. A predetermined number of pulses isgenerated during each of the predetermined time intervals, the pulsesgenerated being used to control an amount of driving of the steppingmotor in each of the plurality of predetermined time intervals. Adifference between the brightness of the image detected and a desiredbrightness of the image determines which of the plurality of lightshields is to be driven by the stepping motor.

[0042] Therefore, if the difference in brightness is large, two or morelight shields may be moved, thereby increasing the speed at which theamount of light is varied. Conversely, if the difference in brightnessis small, then only one light shield is needed to be moved in order tobring the detected image brightness into an allowed brightness range.Since the number of light shields driven can be changed at each timeinterval, the amount of light can initially be varied quickly, and thenvaried accurately in order to prevent hunting.

[0043] Alternatively, light shields having different effects on thechange in brightness per degree of rotation can be employed. In thiscase, the light shield which has the greatest effect on the change inbrightness per degree of rotation is driven in order to quickly changethe detected image brightness. Then another light shield having lesseffect can be driven in order to change the detected image brightnessmore accurately, until the detected image brightness is in the allowedbrightness range.

[0044] In the preferred embodiments, the light shields are arranged tobe rotated on different axis of rotation.

BRIEF DESCRIPTION OF THE DRAWINGS

[0045]FIG. 1 shows a schematic diagram of an endoscope and videoprocessor which functions as a lighting unit for the endoscope,employing a light amount controlling device of the present invention;

[0046]FIG. 2 is a perspective view of a light shield used in the lightamount controlling device shown in FIG. 1;

[0047]FIG. 3 is a side view of the light shield shown in FIG. 2;

[0048]FIG. 4 shows a block diagram of a motor control circuit of thelight amount controlling device shown in FIG. 1;

[0049]FIG. 5 shows a schematic diagram of a microprocessor used in thevideo processor shown in FIG. 1;

[0050]FIG. 6 shows a table of input brightness level values andcorresponding reference values stored in a ROM of the microprocessorshown in FIG. 5;

[0051]FIG. 7 shows a table, stored in the ROM of the microprocessorshown in FIG. 5, showing a number of driving pulses output to a steppingmotor of the light amount controlling device shown in FIG. 1, fordifferent brightness ranges;

[0052]FIG. 8 shows a flowchart of a main program stored in the ROM ofthe microprocessor, shown in FIG. 5;

[0053]FIG. 9 shows a flowchart of an interrupt procedure used to controla driving of the stepping motor of the lights amount controlling device,according to a first embodiment of the present invention;

[0054]FIG. 10A shows a flowchart of a process for determining a numberof pulses to send to the stepping motor, according to the firstembodiment of the present invention;

[0055]FIG. 10B shows a flowchart of a process carried out to determine anumber of pulses to send to the stepping motor, according to amodification of the first embodiment of the present invention;

[0056]FIG. 11A shows a timing diagram of the drive control of thestepping motor of the prior art;

[0057]FIG. 11B shows a timing diagram of the drive control of thestepping motor, according to the first embodiment of the presentinvention;

[0058]FIGS. 12 and 13 show flowcharts of a subroutine for performingendoscope operations, called from the main program shown in FIG. 8,according to a second embodiment of the present invention;

[0059]FIGS. 14A and 14B show timing diagrams of the drive control of thestepping motor, according to the second embodiment of the presentinvention;

[0060]FIG. 15 shows a flowchart of a main program stored in the ROM ofthe microprocessor, shown in FIG. 5, according to a third embodiment ofthe present invention;

[0061]FIG. 16 shows a flowchart of a subroutine for a controlling theamount of light, according to the third embodiment of the presentinvention;

[0062]FIG. 17 shows a graph of a relationship between a rotation angleof the stepping motor and a brightness of an image observed using theendoscope;

[0063]FIG. 18 shows an enlarged portion of the graph shown in FIG. 17;

[0064]FIG. 19 shows a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to a fourth embodiment of the present invention;

[0065]FIG. 20A shows a flowchart of a process for determining a numberof phases of excitation of the stepping motor, according to the fourthembodiment;

[0066]FIG. 20B shows a flowchart of a process for determining a numberof phases of excitation of the stepping motor, according to amodification of the fourth embodiment;

[0067]FIG. 21 shows a table, stored in the ROM of the microprocessorshown in FIG. 5, showing a relationship between a counter, an angle ofrotation of the stepping motor, and a brightness of the lighting unit,according to the fourth embodiment of the present invention;

[0068]FIG. 22 is a perspective view of a light shield used in amodification of the fourth embodiment of the present invention;

[0069]FIG. 23 is a side view of the light shield shown in FIG. 22;

[0070]FIG. 24 shows a graph of a relationship between a rotation angleof the stepping motor and a brightness of an image observed using thelight shield shown in FIG. 22;

[0071]FIG. 25 shows a graph of a brightness of an object observed bythree different types of endoscopes, as a function of an angle ofrotation of the stepping motor;

[0072]FIG. 26 shows a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to a fifth embodiment of the present invention;

[0073]FIG. 27 is a table showing a relationship between a change inbrightness of an object, and an angle of rotation of the stepping motor,corresponding to a graph A shown in FIG. 25.

[0074]FIG. 28 shows an enlarged portion of the graph shown in FIG. 25;

[0075]FIG. 29 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the fifth embodimentof the present invention;

[0076]FIG. 30 is a table showing a relationship between an angle ofrotation of the stepping motor and a change in brightness level,according to a first modification of the fifth embodiment of the presentinvention;

[0077]FIG. 31 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the firstmodification of the fifth embodiment of the present invention;

[0078]FIG. 32 is a table showing the relationship between an angle ofrotation of the stepping motor and a change in brightness of thelighting unit, for different types of endoscopes, according to a secondmodification of the fifth embodiment of the present invention;

[0079]FIG. 33 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the secondmodification of the fifth embodiment of the present invention;

[0080]FIG. 34 is a table showing a relationship between a change inbrightness of an object, and an angle of rotation of the stepping motor,according to a sixth embodiment of the present invention;

[0081]FIG. 35 shows another enlarged portion of the graph shown in FIG.25;

[0082]FIG. 36 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to a sixth embodiment ofthe present invention;

[0083]FIG. 37 is a table showing a relationship between an angle ofrotation of the stepping motor and a change in brightness level,according to a first modification of the sixth embodiment of the presentinvention;

[0084]FIG. 38 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to a first modificationof the sixth embodiment of the present invention;

[0085]FIG. 39 is a table showing the relationship between an angle ofrotation of the stepping motor and a change in brightness of thelighting unit, for different types of endoscopes, according to a secondmodification of the sixth embodiment of the present invention;

[0086]FIG. 40 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to the secondmodification of the sixth embodiment of the present invention;

[0087]FIGS. 41 and 42 show a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to a seventh embodiment of the present invention;

[0088]FIG. 43 illustrates two registers used for storing data, employedin the seventh embodiment of the present invention;

[0089]FIG. 44 shows a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to a modification of the seventh embodiment of thepresent invention;

[0090]FIG. 45 shows a flowchart of a process for determining a number ofpulses to send to the stepping motor, according to an eighth embodimentof the present invention;

[0091]FIGS. 46A and 46B show a flowchart of an interrupt procedure usedto control a driving of the stepping motor of the light amountcontrolling device, according to a modification of the eighth embodimentof the present invention;

[0092]FIG. 47 shows a schematic diagram of an endoscope and videoprocessor which employ a light amount controlling device of the presentinvention, according to a ninth embodiment of the present invention;

[0093]FIG. 48 is a perspective view of light shields used in the lightamount controlling device shown in FIG. 47;

[0094]FIG. 49 shows a schematic diagram of a microprocessor used in thevideo processor shown in FIG. 47;

[0095]FIG. 50 shows a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to the ninth embodiment of the present invention;

[0096]FIG. 51 is a perspective view of another set of light shields usedin a modification of the ninth embodiment; and

[0097]FIG. 52 shows a flowchart of an interrupt procedure used tocontrol a driving of the stepping motor of the light amount controllingdevice, according to the modification of the ninth embodiment of thepresent invention.

DESCRIPTION OF THE EMBODIMENTS

[0098]FIG. 1 shows a structure of an endoscope 1 attached to a videoprocessor 20. The video processor 20 functions as a lighting unit forthe endoscope 1. The endoscope 1 includes an objective lens 2 and animage receiving element 3, such as a CCD (Charge Coupled Device).Further, light from a lamp 22 of the video processor is directed by alight wave guide 4 (such as an optical fiber cable), and a lens 5, to beincident on an object that is to be viewed using the endoscope 1. Thelens 5 increases the angular dispersion of the light emitted by thelight wave guide 4.

[0099] A connector 6 of the endoscope 1 is detachably connected to videoprocessor 20. The connector 6 includes an electronic connector 7, whichelectrically connects the image receiving element 3 to the videoprocessor 20.

[0100] The video processor 20 includes an image signal processingcircuit 21, the lamp 22, a converging lens 24, a light shield 25, amotor 26, a motor control circuit 28 and a microprocessor 30.

[0101] A switch panel 201 is provided with an auto/manual switch forswitching a control mode of the brightness of the observed screenbetween a manual mode and an automatic mode, and up/down switch forincreasing/decreasing the brightness level of the observed screen over arange of 10 levels.

[0102] The image signal processing unit 21 receives an image signal fromthe image receiving element 3, processes the image signal and outputs avideo signal to a monitor 49. Further, a brightness signal correspondingto the received image signal is transmitted to an A/D converter 42, andconverted to a digital signal and sent to the microprocessor 30.

[0103] The lamp 22, which is controlled by the light source controlcircuit 27, emits light towards the light wave guide 4. The brightnesslevel of the light emitted by the lamp 22 is modified in accordance withthe position of the light shield plate 25 relative to the lamp 22. Thelight is then converged by the converging lens 24 and is incident on anRGB filter 23.

[0104] The light shield 25 is rotated about an axis by the motor 26. Therotation of the light shield 25 changes the cross-sectional area of thelight flux that is transmitted from the lamp 22 to the converging lens24. The motor 26 is a stepping motor, and is controlled by the motorcontrol circuit 28.

[0105] The RGB filter 23 is disk shaped and rotates about an axis. TheRGB filter 23 has red (R) filters, green (G) filters and a blue (B)filters arranged sequentially around the disk. The rotation of the RGBfilter 23 is controlled by the filter driving circuit 29.

[0106] The microprocessor 30 controls the operation of the videoprocessor 20 and the endoscope 1.

[0107]FIG. 2 is a perspective view of the light shield 25 and thestepping motor 26. The light shield 25 is a thin plate having a U-shape.The bottom surface of the U-shaped plate is secured to a spindle 251 ofthe stepping motor 26. The axis of the spindle 251 is perpendicular tothe optical axis of a light path L (see FIG. 3).

[0108]FIG. 3 is a side view of the light shield 25 and the steppingmotor 26 as viewed along the optical axis. As shown in FIG. 3, when thevertical surfaces of the light shield 25 are parallel to the opticalaxis, the light path L of the light is hardly shaded by the light shield25.

[0109] By rotating the light shield 25, the amount of light transmittedfrom the lamp 22 to the converging lens 24 is changed.

[0110]FIG. 4 shows a block diagram of the motor control circuit 28. Themotor control circuit 28 includes a pulse control circuit 281 and amotor control circuit 282.

[0111] The pulse control circuit 281 receives a direction signalindicating a direction in which the stepping motor 26 is rotated, and areference pulse signal. The reference pulse signal is modified and sentto the motor 26 from the CPU 30 through an I/O port 41. The phaseswitching signal determines whether a 2-phase excitation or 1-2 phaseexcitation method is used, when driving the stepping motor 26.

[0112] The direction signal indicates the direction that the steppingmotor 26 is to be rotated. A forward direction signal, results in thestepping motor 26 being rotated in a forward direction. The light shield25 is also rotated in the forward direction, thereby reducing the amountof light emitted by the lighting unit along the light path L.

[0113] Conversely, a reverse signal results in the stepping motor 26being rotated in a reverse direction. The light shield 25 is alsorotated in the reverse direction, thereby increasing the amount of lightemitted by the lighting unit along the light path L. In response to thereceived instruction signal, the motor driving circuit 282 outputsdriving pulses according to a predetermined excitation method fordriving the stepping motor 26 synchronously with the driving pulsesignal transmitted from the pulse control circuit 281.

[0114]FIG. 5 shows a configuration of the microprocessor 30. Themicroprocessor 30 includes a CPU (Central Processing Unit) 31 and asystem bus 32. A ROM (Read Only Memory) 33 for storing programs to beexecuted, a RAM (Random Access Memory) 34, an RTC (Real Time Clock) 35,etc. are connected to the system bus 32.

[0115] Character data stored in a VRAM (Video Random Access Memory) 36,is transmitted to a CRTC (Cathode Ray Tube Microprocessor) 37 and thencombined with the image data output by the image processing circuit 21and viewed on the monitor 49.

[0116] The switch panel 201 of the video processor 20, an externalkeyboard 202 and the lamp control circuit 27 for controlling the lamp 22are also connected to the system bus 32 through the I/O ports 38, 39 and40, respectively.

[0117] The motor control circuit 28 receives/transmits signals throughthe I/O port 41. A brightness signal indicating the brightness of theobserved screen which is output by the image signal processing circuit21 is converted from an analog signal to a 256-step digital signal by ananalog-digital converter 42, and then transmitted to the microprocessor30.

[0118] By connecting the connector 6 with the video processor 20, amemory 9 provided inside the endoscope 1 is connected to themicroprocessor 30 through an I/O port 43. The memory 9 stores dataintrinsic to the endoscope 1, such as data which indicates the endoscopetype.

[0119] A DIP switch 11 is connected with the I/O port 43. By turning onor off the DIP switch 11, the input impedance of the I/O port 43 istoggled between a high or low level.

[0120] A programmable interval timer PIT 44 which can be programmed withdifferent time intervals, is connected to the system bus, for providingthe timing interval of the interrupt routine. A counter output terminalof the PIT 44 sends an interrupt to the CPU 31 at the programmed timeintervals.

[0121]FIG. 6 shows a table of the input brightness levels IBL andreference values stored in the ROM 33. A brightness level of one throughten is selected by using the switch panel 201. The brightness level isthe level of the brightness of the image of object observed on themonitor 49. The microprocessor 30 sets a reference value correspondingto the brightness level. The reference values corresponding to thebrightness levels are stored in the ROM 33.

[0122] The microprocessor 30 then compares the brightness signal outputby the image signal processing circuit 21 and converted by the A/Dconverter 42 with the reference value, and controls the motor controlcircuit 28 to drive the stepping motor 26, thereby rotating the lightshield 25, to change the amount of light emitted by the lighting unit ofthe endoscope.

[0123]FIG. 7 shows a table of the number of driving pulses output to thestepping motor 26 for a given brightness difference, according to afirst embodiment of the present invention. The given brightnessdifference is defined as the absolute value of the difference betweenthe digital brightness signal and the reference values stored in the ROM33. The ROM 33 also stores eight values of the number of driving pulses,corresponding to the brightness difference, in two ROM tables (i.e., ROMtable 1 and ROM table 2).

[0124] When the brightness difference is small, the number of drivingpulses stored in both ROM tables is small. As the brightness differenceincreases, the number of driving pulses stored in both ROM tablesbecomes larger. However, for large brightness differences, the values ofthe number of driving pulses stored in ROM table 1 are larger than thecorresponding number of driving pulses stored in ROM table 2.

[0125]FIG. 8 shows a flowchart of a main program stored in the ROM 33,according to the first embodiment of the present invention.

[0126] A predetermined initialization routine is executed in step S80.Then, steps S81 and S82 execute a procedure set by the switch panel 201and a key board input, respectively. A procedure for controlling anoperation of the lamp controlling circuit 27 is then executed in stepS83.

[0127] Step S84 executes a normal operation of the endoscope 1, whilestep S85 executes a procedure for displaying the date and time. Then,other procedures are executed in step S86, and the process is repeated.

[0128] In the first embodiment, information transmitted from the memory9 of the endoscope 1 to the I/O port 43 is used for determining whichone of the ROM tables 1 or 2 is used.

[0129] When the endoscope 1 is connected to the video processor 20,during the procedure of step S84, the endoscope type is read out of thememory 9, and the information is substituted for a predeterminedvariable, and stored in the RAM 34.

Stepping Motor Driven Using a Lookup Table

[0130]FIG. 9 shows a flowchart illustrating the drive control of thestepping motor 26 according to the first embodiment of the presentinvention. The drive control of the stepping motor 26 is an interruptionprocedure executed at predetermined intervals. In this first embodiment,the predetermined interval is 0.05 seconds (i.e., 50 ms).

[0131] Initially in step S90, the brightness signal is transmitted fromthe image signal processing circuit 21. The brightness signal is thenconverted to a brightness value BV, in step S91. Also in step S91, aninput brightness level IBL, which is set by an operator of the endoscope1, is used to generate a reference brightness value, RV. Step S92 thencompares the reference value RV with the brightness value BV todetermine whether the brightness value BV is within an allowedbrightness range β (i.e., step S92 determines whether |RV−BV|>β).

[0132] If the brightness value BV of the observed image is within theallowed range (S92:N) with respect to the input brightness level IBL,the interruption procedure is terminated and control returns to the mainprogram.

[0133] If the difference between the brightness value BV and thereference value RV is out of the allowed range (S92:Y), then step S93determines whether the brightness value BV is greater than the referencevalue RV. If the brightness value BV is greater than the reference valueRV (S93:Y), a forward rotation signal is sent to the motor controlcircuit 28 in step S94. This results in the light shield 25 beingrotated such that the amount of light emitted by the lighting unit ismade smaller.

[0134] Conversely, if the brightness value BV is smaller than thereference value RV (S93:N), a reverse rotation signal is sent to themotor control circuit 28 in step S95. This results in the light shield25 being rotated such that the amount of light emitted by the lightingunit is made larger.

[0135] Step S96 determines the number of drive pulses to be sent to themotor during the interrupt routine. The number of pulses is determinedin accordance with the difference between the brightness of the imagesignal processed by the image signal processing circuit 21, and thereference value. The number of pulses which corresponds to thedifference n brightness is then read out from one of the ROM tables 1 or2. Further, the use of ROM table 1 or 2 is determined by the type ofendoscope being used, as explained in more detail below.

[0136] Then, in step S97, the number of drive pulses determined in stepS96 is sent to the stepping motor 26, and the interruption procedure isterminated.

[0137]FIG. 10A shows the process carried out in step S96, in order todetermine the number of drive pulses to be sent to the pulse controlcircuit 281, according to the first embodiment.

[0138] Step S100 determines whether the type of endoscope 1 connected tothe video processor 20, is used in the digestive system. The datacorresponding to the endoscope type is stored in the memory 9 of theendoscope 1.

[0139] If the type of endoscope corresponds to one used for thedigestive system (S100:Y), then ROM table 1 is used for determining thenumber of pulses for driving the stepping motor 26, in step S101. If thetype of endoscope is for a system (i.e., such as the respiratory system)other than the digestive system (S100:N), then ROM table 2 is used fordetermining the number of pulses for driving the stepping motor 26, instep S102. Then control proceeds to step S97.

[0140] As described above, if the difference between the brightnessvalue BV and the reference value RV is relatively large, a greaternumber of pulses are applied to the stepping motor 26, and therefore thelight shield 25 rotates at a high speed during one interrupt procedure.When the difference between the brightness signal value and thereference value is relatively small, a smaller number of pulses areapplied to the stepping motor 26. In the latter case, since the lightshield 25 is rotated by a small amount during one interrupt procedure,the light shield 25 can be easily positioned at the optimum location.

[0141] Further, the number of pulses sent to the stepping motor 26 isdifferent depending on the type of endoscope being used. Therefore, thecontrol of the stepping motor 26 can be optimized for each type ofendoscope.

[0142]FIG. 10B shows the process carried out in step S96, in order todetermine the number of drive pulses to be sent to the stepping motor26, according to a modification of the first embodiment.

[0143] In modification of the first embodiment, the type of endoscope isdetermined in accordance with a position of the DIP switch 11. Bysetting the DIP switch 11 to one of two positions, the type of endoscopemay be set.

[0144] Therefore, step S103 which is similar to step S100, determineswhether the type of endoscope 1 connected to the video processor 20, isused in the digestive system.

[0145] If the type of endoscope corresponds to one used for thedigestive system (S103:Y), then ROM table 1 is used for determining thenumber of pulses for driving the stepping motor 26, in step S104. If thetype of endoscope is for a system (i.e., such as the respiratory system)other than the digestive system (S103:N), then ROM table 2 is used fordetermining the number of pulses for driving the stepping motor 26, instep S105. Then control proceeds to step S97.

[0146] Therefore, by employing a simple circuit, the type of endoscopemay be easily selected by an operator. Further, since the type ofendoscope can be selected, the control of the stepping motor 26 can beoptimized for each type of endoscope, as explained above.

[0147]FIG. 11B is a timing chart showing the drive control of thestepping motor 26, according to the first embodiment. The chart shows anexample when the stepping motor 26 is rotated 10 degrees. In thisexample, it is assumed that the stepping motor 26 rotates 0.5 degreesfor every drive pulse. According to this first embodiment, as shown inFIG. 11B, the number of pulses at every interruption procedure changes(i.e., 8, 4, 4, 2 and 2). Further, as shown in FIG. 11B, only fiveinterruption procedure are required, for a total time of 0.25 seconds.Furthermore, the light shield 25 is positioned at the optimum position,since the number of driving pulses is not limited to a multiple ofthree.

[0148] As described above, the stepping motor 26 is driven during fiveinterrupt procedures. The number of pulses sent to the stepping motor 26during each interrupt is determined from the ROM table 1 or 2.However,by programming another ROM table having different numbers of pulsescorresponding to the range of brightness differences, all 20 pulsescould have been sent to the motor during the first interrupt procedure.The number of pulses sent to the stepping motor 26 is only limited bythe period of a pulse and the interval between successive interrupts.

[0149] If the type of endoscope used is for the digestive system, theobjective area is relatively wide and the object distance fluctuates. Inthis case, by using ROM table 1, the endoscope quickly responds to thechange in the object distance. If the type of endoscope used is not forthe digestive system, then the observing area is fairly narrow andfurther the object distance does not fluctuate. In this case, by usingROM table 2, the brightness can be precisely adjusted.

[0150] As described above, by adjusting the number of pulses sent to thestepping motor 26 in accordance with a difference between the brightnessvalue BV and the reference brightness value RV, the amount of lightemitted by the lighting unit can be changed quickly thereby improvingthe response time of the endoscope. Further, since the number of stepscan be made small when the detected brightness is slightly out of theallowed brightness range, the precision of the control of the lightamount can be increased without reducing the response time of theendoscope. Furthermore, the stability of the control of the light amountis improved, and the occurrence of hunting is prevented.

[0151] In the first embodiment described above, two types of endoscopesare categorized (i.e., those used for the digestive system, and allother endoscopes). However, it is possible to have more than twocategories of endoscopes, in which case, more than two ROM tables ofstored numbers of driving pulses would be required.

Adjustable Intervals Between Successive Interrupts

[0152]FIG. 8 also illustrates a flowchart of a main program according toa second embodiment of the present invention. FIGS. 12 and 13 illustratea flowchart of a subroutine of the endoscope operations called from stepS84 of the main program shown in FIG. 8.

[0153] In the second embodiment, the PIT 44 is programmed with one oftwo different interval timing values depending on the type of endoscope1 that is connected to video processor 20. Further, a flag U1 is setequal to 1 when the endoscope 1 is connected to the video processor 20,and is set equal to 0 when the endoscope 1 is not connected to the videoprocessor 20.

[0154] Step S120 determines whether the endoscope 1 is currentlyconnected to the video processor 20, by examining the setting of theflag U1. The setting of the flag U1 is changed when the change in thephysical connection of the endoscope 1 to the video processor 20, isdetected. If U1 is equal to 0 (S120:Y), then the endoscope 1 is notcurrently connected to the video processor. Step S121 then monitors theconnection status of the endoscope 1 to the video processor 20. If theendoscope 1 is not connected to the video processor 20 (S121:N), thenthe routine ends and control returns to the main program.

[0155] If the endoscope 1 is connected to the video processor 20(S121:Y), then U1 is set equal to 1 in step S122. Step S123 thendetermines the type of endoscope 1 connected to the video processor 20.The process carried out in this step is shown in FIG. 13, and will bedescribed in more detail later. Then, the name of the endoscope type isdisplayed on the monitor 49, in step S126, and the routine ends.

[0156] In step S120, if the endoscope 1 was currently connected to thevideo processor 20 (S120:N) then step S127 monitors the connectionstatus of the endoscope 1 to the video processor 20. If the endoscope 1remains connected to the video processor 20 (S125:Y), then the routineends and control returns to the main program.

[0157] If the endoscope 1 is disconnected from the video processor 20(S125:N), then U1 is set to 0 in step S126, and the name of the type ofendoscope is cleared from the display on the monitor 49, in step S127.The routine then ends and control returns to the main program.

[0158]FIG. 13 shows the process carried out in step S123 in more detail.

[0159] Step S130 determines whether the endoscope 1 is the type used forthe digestive system. In the second embodiment, the type of endoscopecan be determined using data stored in the memory 9, or by a setting ofthe DIP switch 11.

[0160] If the endoscope 1 is the type used for the digestive system(S130:Y) then the PIT counter 44 has a count value n set equal to N1 instep S131. Otherwise, when the endoscope 1 is a different type ofendoscope (S130:N), the count value 1 is set equal to N2 in step S132.

[0161] As described above, the interrupt time interval can be programmedin the PIT 44 to have one of two values, depending on the type ofendoscope connected to the video processor 20. In the second embodiment,the two time interval values are 50 ms and 80 ms. Further, the number ofpulses used to drive the stepping motor 26 is the same for each type ofendoscope.

[0162] The interrupt routine used to control the drive of the steppingmotor 26 in the second embodiment is similar to the drive control of thestepping motor 26 in the first embodiment, described above and shown inFIG. 9. However, in step S96, the number of pulses to drive the steppingmotor is a fixed value.

[0163]FIGS. 14A and 14B show timing diagrams of the drive control of thestepping motor 26 for an endoscope used for the digestive system, andanother type of endoscope, such as an endoscope used for the respiratorysystem, respectively When using the endoscope for the digestive system,since the area to be observed in the digestive system is relatively wideand the object distance varies frequently, the interruption timeinterval is set to 50 ms. Therefore, the light shield 25 can be movedquickly in response to a change in the object distance.

[0164] When using the endoscope for a different system, such as therespiratory system, since the area to be observed is small and theobject distance does not vary frequently, the interruption time intervalis set to 80 ms. Therefore, the light shield 25 can be moved withgreater stability.

[0165]FIG. 15 illustrates a main program of the operation of a thirdembodiment of the present invention. In the third embodiment, the motordrive control is executed as a part of a subroutine for controlling theamount of light emitted by the lighting unit, and not as an interruptprocedure. Further, in this embodiment, the DIP switch 11 sets thevalues N1 and N2, using software in the microprocessor 30, in order toset the time interval between executions of the subroutine.

[0166] The main program for the third embodiment is similar to the mainprogram for the first embodiment, shown in FIG. 8, with steps S150through steps S155 the same as steps S80 through S85.

[0167] Thus, in step S150 the predetermined initialization routine isexecuted. Then, steps S151 and S152 execute a procedure set by theswitch panel 201 and a keyboard input, respectively. A procedure forcontrolling an operation of the lamp controlling circuit 27 is thenexecuted in step S153.

[0168] Step S154 executes a normal operation of the endoscope 1, whilestep S155 executes a procedure for displaying the date and time. In stepS156, the subroutine for controlling the amount of light emitted by thelighting unit is called, and then other processing is executed in stepS157. The program is then repeated.

[0169] In step 5154 of the main program, the subroutine called toperform the endoscope operations is similar to the subroutine in thesecond embodiment, shown in FIG. 12. However, in step S123, only thetype of endoscope is determined (i.e., by reading the memory 9, or froma setting of the DIP switch 11), since the values N1 and N2 are setusing the DIP switch 11.

[0170]FIG. 16 shows a flowchart of a subroutine for controlling theamount of light emitted by the lighting unit, which is called in stepS156 of the main program. In this routine a variable c is used as acounter. In step S160, the value of c is incremented by 1 (one). StepS161 determines whether the DIP switch 11 is OFF. If the DIP switch 11is OFF (S161:Y), then c is divided by the value N1 in step S162, and aremainder REM is obtained. If the DIP switch 11 is ON (S161:N), then cis divided by the value N2 in step S163, and the remainder REM isobtained. Then, step S164 determines whether the remainder REM is equalto 0 (zero). If REM is equal to 0 (S164:Y), the motor driving subroutineshown in FIG. 9 is called in step S165, and then the routine ends. IfREM is not equal to 0 (S164:N), the routine ends.

[0171] Thus, in the third embodiment, the interval at which the motordriving pulses are applied is controlled by the setting of the DIPswitch 11. If, for example, the main routine shown in FIG. 15 takes 3 msto execute, N1 is set equal to 17 and the DIP switch 11 is turned OFF,then the motor driving procedure is executed approximately every 50 ms.Further, if N2 is set equal to 27, and the DIP switch is turned ON, thenthe motor driving procedure is executed approximately every 80 ms .

[0172] In the third embodiment, the DIP switch 11 can usually be set toits OFF position. Therefore, the control of the light amount emitted bythe lighting unit is executed more frequently, and has a faster responsetime. If the light shield 25 does not converge to a certain position asa result of a change in a characteristic of the light amount controllingdevice when the endoscope type is changed or the lamp is changed, byturning the DIP switch 11 ON, the hunting condition will be prevented.

[0173] In the above-described embodiment, with the DIP switch 11, one ofonly two conditions is selectable. However, if a rotary switch or thelike is used, more than two conditions, or more than two constants Nn(n=1, 2, 3, . . . ) can be used. In this case, the optimum time intervalof driving the motor 26 can be selected depending on the kind of theendoscope, ambient conditions, mechanical characteristics, and/orpreferences of an operator.

[0174] According to the third embodiment, since the time interval of themotor driving procedure is varied, the response of the movement of thelight shield 25 can be made as quickly as possible without hunting.Further, even if hunting occurs as a result of a slow response in thechanging of the brightness after driving the stepping motor 26, byelongating the time period, and without changing the software orhardware, the operation of the light amount controlling device can bemade stable.

[0175] Further, as described above, the motor driving operation can beexecuted as an interruption procedure or a part of a normal procedure.Furthermore, the time interval can be determined in software or by amanual operation, or in accordance with the type of endoscope attachedto the video processor, or by setting a DIP switch. However, the settingof the time interval is not limited to these methods, but may anothermethod, such as direct data entry etc.

Phase Controlled Driving Embodiments

[0176]FIG. 17 shows the curve y=f(θ) which is the relationship betweenthe rotation angle θ and the brightness signal value (A/D convertedvalue) y of the image observed using the endoscope 1. FIG. 18 shows anenlarged view of a portion of the curve y=f(θ) shown in FIG. 17. Huntingwill not occur if the following equation, as illustrated in FIG. 18, issatisfied:

|dy/dθ|Δθ≦2β

[0177] therefore

|dy/dθ|≦2βΔθ  (a)

[0178] where,

[0179] β is a limit relative to the reference brightness value, of theallowed brightness signal (i.e., the allowed brightness range is equalto the reference brightness signal ±β),

[0180] Δθ is a rotation angle at each motor driving operation, and

[0181] |dy/dθ| is a slope of a tangent on a tangent of the curve y=f(θ)at the reference brightness value.

[0182] Further, the stepping motor 26 is considered to have no delaywhen driven by the control system.

[0183] If the curve of y=f(θ) is a monotonically decreasing convexfunction, then as shown in FIG. 17, the absolute value of |dy/dθ|increases as θ increases. Therefore, if θ is relatively high, equation(a) above may not be satisfied. In this case, the method of exciting thestepping motor 26 is switched from 2 phase excitation to 1-2 phaseexcitation (i.e., excitation of the motor alternates between singlephase and two phase, with each driving pulse). When the motor is drivenwith 1-2 phase excitation, the rotation angle Δθ₁ of the stepping motor26 is equal to a half the rotation angle Δθ₂ when the motor is drivenwith 2 phase excitation. Therefore by driving the stepping motor 26 with1-2 phase excitation, 2β/Δθ is doubled and equation (a) is satisfied.

[0184] For example, if one pulse is applied to the stepping motor 26,when using 2 phase excitation, the resulting rotation angle Δθ₂ is 0.5degrees, and β equals 1. The right side of the equation (a) is thereforeequal to 4.

[0185] According to the curve shown in FIG. 17, if θ is greater than 15degrees, |dy/dθ| is greater than four. Therefore, in the range where θis greater than 15 degrees, equation (a) is not satisfied. If the motorexcitation method is switched to 1-2 phase method, 2β/Δθ is equal to 8.According to the curve shown in FIG. 17, in the range where θ is greaterthan 15 degrees, |dy/d|θ is less than 8. Therefore, by switching themotor to have 1-2 phase excitation, equation (a) is satisfied when θ isgreater than 15 degrees. Thus, since the change in brightness per unitdegree of rotation of the stepping motor 26 when 1-2 phase excitation isemployed, is equal to half the change in brightness per unit degree ofrotation of the stepping motor 26 when 2 phase excitation is employed,the accuracy of the movement of the stepping motor 26 is increased, andthe hunting problem can be avoided.

[0186]FIG. 19 shows a flowchart of an interrupt routine for controllingthe driving of the stepping motor 26 according to a fourth embodiment ofthe present invention. In this embodiment, the PIT 44 is programmed suchthat the interrupt routine is executed every 30 ms. Further, the mainprogram is the same program used in the first embodiment, and shown inFIG. 8.

[0187] In the fourth embodiment, a counter value c represents thecumulative number of pulses that have been applied to the stepping motor26, and P represents a number of pulses to be applied to the steppingmotor 26 during one execution of the interrupt routine. The motorexcitation method is given by the flag U2. If U2=0, then 2 phaseexcitation is used. If U2=1, then 1-2 phase excitation is used. Further,a value N is equivalent to the number of pulse applied to the motor 26when equation (a) is satisfied, and Δc is a value by which the counter cis incremented.

[0188] In step S190 the phase of excitation of the stepping motor 26 isdetermined. FIG. 20A shows a flowchart of a process for determining anumber of phases of excitation of the stepping motor 26 according to thefourth embodiment.

[0189] Initially, in step S200, the counter value c is compared with thepredetermined value N. If c is not greater than N (S200:N), then stepS205 determines whether the stepping motor 20 has 2 phase excitation bychecking the setting of the flag U2. If U2 is equal to 1 (S205:Y), thenthe flag U2 is set to 0 and Δc is set equal to 2P, in step S206. Then,in step S207, the 2 phase excitation method is set. If the flag U2 isnot equal to 1 (S205:N), then steps S206 and S207 are skipped.

[0190] If the value of c is greater than N (S200:Y), then controlproceeds to step S202, which determines whether the stepping motor has1-2 phase excitation by checking the setting of the flag U2. If U2 isequal to 0 (S202:Y), then the flag U2 is set to 1 and Δc is set equal toP, in step S203. Then, in step S204, the 1-2 phase excitation method isset. If the flag U2 is not equal to 0 (S202:N), then steps S203 and S204are skipped.

[0191] In step 5208, the brightness signal is received, the brightnessvalue BV corresponding to the received brightness signal is determinedin step S209. Control then continues to step S191 of the flowchart shownin FIG. 19.

[0192] In step S191, the reference value RV is determined in accordancewith the input brightness level IBL set by the operator of the endoscope1. Step S192 then determines whether the brightness value BV of thereceived brightness signal is within the allowed brightness range (i.e.,|RV−BV|>β)

[0193] If the brightness value BV is not within the allowed brightnessrange (S192:Y), the brightness value BV is compared with the referencevalue RV, in step S193. Otherwise (S192:N), the routine is ended.

[0194] Then, if the brightness level is greater than the referencebrightness level (S193:Y), the forward drive pulse is sent, in stepS194, and the counter value c is incremented by Δc, in step S195.Otherwise (S193:N), the reverse drive pulse is sent in step S196, andthe counter value c is decremented by Δc, in step S197.

[0195] Step S198 then sends the predetermined number of pulses to themotor, and the routine is ended.

[0196]FIG. 21 is a table showing the relationship between the count c,the angle of rotation of the light shield 25, and the amount of lighttransmitted to the converging lens 24 from the light source 22. As shownin FIG. 21, when the count c is 0, the angle of rotation is 0°, and theamount of light transmitted is large. As the count c increases, theangle of rotation increases, and the amount of light transmitted becomessmaller. When the count c is 120, the angle of rotation is 30°, and theamount of light transmitted is small.

[0197] As described above, when the light shield 25 is rotated in orderto reduce the amount of light transmitted, the method of exciting themotor 26 is changed from 2 phase excitation to 1-2 phase excitation.Further, if the cumulative number of pulses that has been sent to thestepping motor as counted by counter c is less than or equal to thepredetermined value N, then the stepping motor 26 is driven with 2 phaseexcitation. Therefore, the light shield 25 is initially rotated quickly.After the cumulative number of pulses has exceed the predetermined valueN, the stepping motor 26 is driven with 1-2 phase excitation. Thus, thelight shield 25 is rotated in smaller steps, and therefore moreaccurately, during each successive interrupt. As a result of the controlprocedure described above, the light shield 25 is rotated such that theamount of light transmitted is changed quickly and accurately, whilepreventing hunting.

[0198]FIG. 20B shows a flowchart of a process for determining a numberof phases of excitation of the stepping motor 26 in step S190, accordingto a modified control of the fourth embodiment. The process carried outis similar to that described above and shown in the flowchart of FIG.20A, except that steps S208 and S209 are performed before the type ofexcitation of the motor has been determined. Further, an additional stepS201 is performed.

[0199] As shown in FIG. 20B, the brightness signal is received in stepS208, and then the brightness value BV is determined in step S209. Thenin step S200 the value of c is compared with the predetermined value N.If c is less than or equal to N (S200:N), steps S205 through S207 areexecuted as described above.

[0200] However, if c is greater than N (S200:Y), then step S201 isexecuted before step S202. In step S201, the value of BV is comparedwith a predetermined value M. The predetermined value M is smaller thanthe minimum reference value. If BV is greater than M (S201:Y), thensteps S205 through S207 are executed, and the stepping motor 26 is setto be driven with 2 phase excitation. If BV is less than or equal to M(S201:N) then steps S202 through S204 are executed as described aboveand the stepping motor 26 is set to be driven with the 1-2 phaseexcitation.

[0201] As described above, in the modified fourth embodiment, even ifthe cumulative number of pulses as counted by counter c is larger thanthe predetermined value N, if the brightness value BV is larger than thepredetermined value M, the stepping motor 26 is driven with 2 phaseexcitation. With this modified embodiment, in case the brightness valueis large, the stepping motor 26 will be driven with 2 phase excitationfor a longer time and therefore the time required to rotate the lightshield 25 such that the brightness value is brought into the allowedbrightness range, is reduced. Further, when the value of BV is less thanM, the stepping motor 26 is driven with 1-2 phase excitation andtherefore the accuracy of rotation of the light shield 25 remains high,when the brightness value is near the allowed brightness range.

[0202]FIGS. 22 and 23 show a light shield 25M used in a secondmodification of the fourth embodiment described above. The light shield25M is operated with the control of the flowcharts shown in FIGS. 19 and20A.

[0203] In the second modification of the fourth embodiment, the lightshield 25M is planar having a rectangular cross-section. Further, therelationship between the angle of rotation of the light shield 25 M andthe A/D brightness signal y illustrated in FIG. 24 is different than therelationship between the angle of rotation of the light shield 25 andthe A/D brightness signal y, shown in FIG. 17. As shown in FIG. 24,y=g(θ)

[0204] here, y is the brightness and

[0205] θ is the angle of rotation.

[0206] The curve y=g(θ) is also a monotonically decreasing function.Further, |dy/dθ| generally decreases as θ increases.

[0207] Therefore, in the second modification of the fourth embodiment,the stepping motor 26 is driven with 1-2 phase excitation if the angleof rotation θ is less than or equal to a predetermined angle, and 2phase excitation if the angle of rotation θ is larger than thepredetermined angle. In this case the predetermined angle is equal tothe angular position of the stepping motor 26 when the counter value isequal to a value N.

[0208] If the light shield 25M is driven with the control of theflowcharts shown in FIGS. 19 and 20B, the stepping motor 26 is drivenwith 1-2 phase excitation when θ is less then or equal to apredetermined angle, and driven with 2 phase excitation when θ is notless than the predetermined value. Further, if the brightness signalvalue exceeds the maximum reference value REFmax, (REFmax=161, see FIG.25), then the stepping motor 26 is driven with 2 phase excitationregardless of the counter value c.

[0209]FIG. 25 shows a graph of the brightness y of the object observedby three different types of endoscopes, as a function of the angle ofrotation θ of the stepping motor 26. The endoscope A represents theendoscope 1 used for the digestive system, while endoscope C representsan endoscope used in the respiratory system. The difference in thebrightness characteristics of the endoscopes can be attributed to thedifferent f-numbers of the objective lenses and the different number ofoptical fibers used in the respective endoscopes.

[0210] As further shown in FIG. 25, the value of |dy/dθ| for theendoscope C is small for all values of θ, and therefore the steppingmotor 26 can always be driven with 2 phase excitation.

[0211] Therefore, in a third modification of the fourth embodiment, thetype of endoscope is first transmitted to the video processor 20. If theendoscope 1 is a type A or B, then step S202 is performed as describedabove. However, if the endoscope is a type C, then control proceeds tostep S207, where the stepping motor 26 is set to be driven with 2 phaseexcitation.

[0212] According to the third modification of the fourth embodiment, themethod of driving the stepping motor 26 is determined in accordance withthe type of endoscope being used, the brightness of the observed image,and position of the light shield 25. Therefore, the brightness of theobserved image can be adjusted quickly without causing hunting.

Brightness Level Ranger Setting Embodiments

[0213]FIG. 26 shows a flowchart illustrating the control of the drivingof the stepping motor 26, according to a fifth embodiment of the presentinvention. The fifth embodiment also operates using the main programshown in FIG. 8, with the interrupt being executed every 30 ms. Furthersthe number of pulses to be applied to the stepping motor 26 during eachinterrupt is 2. Therefore, after each interrupt, the stepping motor 26is rotated 1°.

[0214] In step S260, the brightness signal is received. Step S261determines the brightness value BV of the brightness signal, and thereference value corresponding to an input brightness level IBL. Then,step S262 determines whether the brightness value BV is greater than thereference value RV. If the brightness value BV is greater than thereference brightness level RV (S262:Y), the forward drive signal issent, in step S263. Otherwise (S262:N), the reverse drive signal is sentin step S264.

[0215] A subroutine for determining the number of drive pulses to besent to the motor, is then called in step S265. After the number ofdrive pulses has been determined and then sent to the motor, the routineis ended.

[0216]FIG. 27 is a table showing the relationship between the change inthe brightness signal value Δy and the rotation angle θ of the steppingmotor 26, which corresponds to the curve A of the graph in FIG. 25. Asshown in FIG. 27, the brightness levels are arranged into 5 groups, withthe change in brightness level Δy per degree of rotation of the lightshield 25, decreasing as the brightness level y increases.

[0217]FIG. 28 shows a partially enlarged view of the graph of FIG. 25.As shown in FIG. 28, in order to adjust the light shield 25 such thathunting does not occur, the change in brightness signal value Δy perchange in rotation of stepping motor 26 during an interrupt (i.e., 1°)must be less than the allowed brightness range (i.e., 2β).

[0218] In the fifth embodiment, the allowable brightness ranges βn (n=1,2, 3) are determined such that β1=2, β2 =3, and β3=4. Further, thebrightness range is selected in accordance with the input brightnesslevel IBL set using the switch panel 201. The range β1 is used when theselected brightness level is 10. If the selected input brightness levelIBL is 9, 8 or 7, then the range β2 is used. If the selected inputbrightness level IBL is 6 or lower, then the range β3 is used.

[0219] As shown above, as the input brightness level IBL decreases, theallowed brightness range βn increases, since the change in brightnessper degree of rotation is small when the brightness value BV is high,and is large when the brightness value DV is low, as shown in FIG. 25.Or in other words, |dy/dθ| increases as θ increases. By selecting theallowed brightness range as described above, a quick response inrotation of the light shield can be obtained without hunting.

[0220]FIG. 29 is a flowchart illustrating step S265 of FIG. 26, inaccordance with the fifth embodiment.

[0221] Step S290 determines whether the input brightness level IBL isequal to 10. If the input brightness level IBL is equal to 10 (S290:Y),then step S291 determines whether |RV−BV| is greater than β1 (i.e.,two). If |RV−BV| is greater than β1 (S291:Y), then the predeterminednumber of pulses (i.e., two) is applied to the stepping motor 26, instep S297.

[0222] If |RV−BV| is not greater than β1 (S291:N), then the subroutineends, and the interrupt procedure shown in FIG. 26 is terminated.

[0223] If the input brightness level IBL is equal to 9, 8 or 7 (S290:N,S292:Y)), and |RV−BV| is greater than β2 (S293:Y), control proceeds tostep S297 where the predetermined number of pulses are applied to thestepping motor 26. However, if |RV−BV| is not greater than β2 (S293:N),then the subroutine ends and the interruption procedure is terminated.

[0224] If the input brightness level IBL is 6 or lower (S294:Y), and|RV−BV| is greater than β3 (S295:Y), then control proceeds to step S297where the predetermined number of pulses are applied to the steppingmotor 26. If |RV−BV| is not greater than β3 (S295:N), the then thesubroutine ends and interruption procedure is terminated.

[0225] If the input brightness level IBL does not have a value between 1through 10 inclusive, then the input brightness level IBL is forciblyset to a default value, e.g., 5, in step S296, and the interruptionprocedure is terminated.

[0226] As described above, in the fifth embodiment, the number ofdriving pulses sent to the stepping motor 26 is a constant number forall input brightness levels. However, the allowed brightness range βchanges in accordance with the input brightness level IBL.

[0227]FIG. 30 is a table showing the relationship between the angle ofrotation θ of the stepping motor 26, and the change in brightness levelΔy per degree of rotation of the stepping motor 26, according to amodified control of the fifth embodiment. This table also corresponds tothe curve A shown in FIG. 25. In the modified fifth embodiment, therange βn is changed in accordance with the angle of rotation θ of thestepping motor 26. Further, the number of pulses sent to the steppingmotor 26 is two.

[0228]FIG. 31 shows the motor driving subroutine according to themodified fifth embodiment, called in step S265 of the interrupt routine,shown in FIG. 26.

[0229] In step S310, if the angle of rotation θ is greater than or equalto θ₁ (S310:Y), then step S311 determines whether |RV−BV| is greaterthan β4. If |RV−BV| is greater than β4 (S311:Y), then the predeterminednumber of pulses (i.e., two) is applied to the stepping motor 26, instep S317. If |RV−BV| is not greater than β4 (S311:N), then thesubroutine ends, and the interrupt procedure shown in FIG. 26 isterminated.

[0230] If the angle of rotation θ is greater than or equal to θ₂ (S310N,S312:Y), and |RV−BV| is greater than β5 (S313:Y), then the predeterminednumber of pulses are applied to the stepping motor 26, in step S317.However, if |RV−BV| is not greater than β5 (S313:N), then the subroutineends and the interruption procedure is terminated.

[0231] If the angle of rotation θ is greater than or equal to 0 (S312:NS314:Y), and |RV−BV| is greater than β6 (S315:Y), then the predeterminednumber of pulses are applied to the stepping motor 26, in step S317. If|RV−BV| is not greater than β6 (S315:N), the then the subroutine endsand interruption procedure is terminated.

[0232] If the angle of rotation θ is less than 0 (S314:N) then the angleof rotation θ is reset to 0, and the interruption procedure isterminated.

[0233] In the modified fifth embodiment, the allowed brightness rangesβn are set such that β4=4, β5=3, and β6=2. Further, as described above,the allowed brightness range is set in accordance with the angularposition of the light shield 25.

[0234]FIG. 32 has tables showing the relationship between the angle ofrotation θ of the stepping motor 26, and the change in brightness levelΔy per degree of rotation of the stepping motor 26, according to asecond modified control of the fifth embodiment. The tables A, B and Ccorrespond to the curves A, B and C, respectively, shown in FIG. 25. Thecurve A represents an endoscope used for the digestive system, the curveB represents an endoscope used for the esophagus, and curve C representsan endoscope used for the respiratory system excluding the esophagus(i.e., such as the bronchial tubes, nose etc.).

[0235] In this embodiment, the range βn is changed in accordance withthe angle of rotation θ of the stepping motor 26, and the type ofendoscope.

[0236]FIG. 33 shows the motor driving subroutine according to the secondmodified control of the fifth embodiment, called in step S265 of theinterrupt routine, shown in FIG. 26.

[0237] Step S330 determines whether a type A endoscope is connected tothe video processor 20. The endoscope type is stored in the memory 9, asdescribed before.

[0238] If the endoscope is a type A endoscope (S330:Y), then step S331determines whether the angle of rotation θ is greater than θ₃. If theangle of rotation θ is greater than θ₃, and |RV—BV| is greater than β7(S331:Y, S332:Y), then the predetermined number of pulses is sent to thestepping motor 26, in step S340, and the subroutine is ended. If |RV−BV|is not greater than β7 (S332:N), then the subroutine ends, and theinterrupt procedure is terminated.

[0239] If the angle of rotation θ is not greater than θ₃, and |RV−BV| isgreater than β8 (S331:N, S333:Y), then control proceeds to step S340where the predetermined number of pulses is sent to the stepping motor26. Otherwise (S334:N), the subroutine is ended, and the interruptprocedure is terminated.

[0240] In case the endoscope is a type B endoscope (S330:N, S335:Y),then step S336 determines whether the angle of rotation θ is greaterthan θ₄. If the angle of rotation θ is greater than θ₄, and |RV−BV| isgreater than β9 (S336:Y, S337:Y), then control proceeds to step S340where the predetermined number of pulses is sent to the stepping motor26. If |RV−BV| is not greater than β9 (S337:N), then the subroutineends, and the interrupt procedure is terminated.

[0241] If the angle of rotation θ is not greater than θ4, and |RV−BV| isgreater than β10 (S336:N, S338:Y), then control proceeds to step S340where the predetermined number of pulses is sent to the stepping motor26. Otherwise (S338:N), the subroutine is ended, and the interruptprocedure is terminated.

[0242] In the case that the endoscope is a type C endoscope (S335:N),step S339 determines whether |RV−BV| is greater than β11. If |RV−BV| isgreater than or equal to β11 (S337:Y) then the predetermined number ofpulses is sent to the stepping motor 26, in step S340, and thesubroutine is ended. Otherwise (S337:N), the subroutine is ended, andthe interrupt procedure is terminated.

[0243] In the above described modified fifth embodiment, the allowedbrightness ranges βn are set such that β7=4,βa=3, for the type Aendoscope, β9=3, β10=2, for the type B endoscope, and β11=2, for thetype C endoscope. Further, the threshold angle θ3=23° and the thresholdangle θ4=20°.

[0244] In the fifth embodiment described above, the number of pulsessent to the stepping motor 26 remained constant, while the allowedbrightness range was varied in accordance with the input brightnesslevel. A sixth embodiment will be described below, in which the allowedbrightness range remains constant for all input brightness levels, butthe number of pulses sent to the stepping motor 26 is varied inaccordance with the input brightness levels.

[0245]FIG. 34 is a table showing the relationship between the change inthe brightness signal value Δy and the rotation angle θ of the steppingmotor 26, according to a sixth embodiment of the present invention. Asshown in FIG. 34, the brightness levels are arranged into 3 groups, withthe change in brightness level Δy per degree of rotation of the lightshield 25, decreasing as the brightness level y increases. In the sixthembodiment, the stepping motor 26 is rotated by 0.5° when one drivepulse is applied.

[0246]FIG. 35 shows a partially enlarged view of the graph of FIG. 25.As shown in FIG. 35, in order to adjust the light shield 25 such thathunting does not occur, the change in brightness signal value Δy perchange in rotation of stepping motor 26 during an interrupt (i.e., 0.5°)must be less than the allowed brightness range (i.e., 2β).

[0247] The sixth embodiment operates using the main program shown inFIG. 8, and the interrupt routine shown in FIG. 26.

[0248]FIG. 36 shows the subroutine according to the sixth embodiment,called in step S265 of the interrupt routine, shown in FIG. 26. In thesixth embodiment, the allowed brightness range, 2β is set equal to 6.

[0249] Step S360 determines whether the brightness value is within theallowed brightness range (i.e., |RV−BV|>β). If the brightness value iswithin the allowed brightness range (S360:N), then the subroutine isended, and the interrupt routine is ended. Otherwise (S360:Y), if theinput brightness level IBL is equal to 10 in step S361, then thestepping motor 26 is driven with P1 pulses, in step S362, and thesubroutine is ended. In the sixth embodiment, P1=3.

[0250] If the input brightness level IBL is not equal to 10 (S361:N) butone of 9, 8 or 7, in step S363, then the stepping motor 26 is drivenwith P2 pulses, in step S364, and the subroutine is ended. In the sixthembodiment, P22. If the input brightness level IBL is less than or equalto 6 (S363:N), in step S365, then the stepping motor 26 is driven withP3 pulses, in step S366, and the subroutine is ended. In the sixthembodiment, P3−1.

[0251] If the brightness level is not set or is erroneously set to avalue outside the range 1 through 10, then the input brightness levelIBL is set to 5, in step S367, and the routine ends.

[0252] As described above, the stepping motor 26 is driven with a highernumber of pulses when the input brightness level IBL is high, than whenthe input brightness level IBL is low. Therefore, the control of therotation of the light shield 25 can be optimized depending on thedesired input brightness level IBL.

[0253]FIG. 37 is a table showing the relationship between the change inthe brightness signal value Δy and the rotation angle θ of the steppingmotor 26, according to a modified control of the sixth embodiment. Asshown in FIG. 37, the change in brightness level Δy per degree ofrotation of the light shield 25, increases as the angle of rotation θ ofthe stepping motor 26 increases. In the modified sixth embodiment, thestepping motor 26 is rotated by 0.5° when one drive pulse is applied.Further, the number of pulses to be applied to the stepping motor 26changes in accordance with the angle of rotation θ of the stepping motor26.

[0254]FIG. 38 shows the subroutine according to the modified control ofthe sixth embodiment, called in step S265 of the interrupt routine,shown in FIG. 26.

[0255] Step S380 determines whether the brightness value is within theallowed brightness range (i.e., |RV−BV|>β). If the brightness value iswithin the allowed brightness range (S380:N), then the subroutine isended, and the interrupt routine is terminated. Otherwise (S380:Y), ifthe angle of rotation θ is greater than θ₁, in step S381, then thestepping motor 26 is driven with P4 pulses,in step S382, and thesubroutine is ended. In this embodiment, P4=1, and θ₁=23°.

[0256] If the angle of rotation θ is less than θ₁ (S381:N), but greaterthan θ₂ in step S383, then the stepping motor 26 is driven with P5pulses, in step S384, and the subroutine is ended. In this embodiment,P5=2, and θ₂=16°.

[0257] If the angle of rotation θ is less than θ₂ (S383:N), but greaterthan 0° in step S385, then the stepping motor 26 is driven with P6pulses, in step S386, and the subroutine is ended. In this embodiment,P6=3.

[0258] If the angle of rotation θ is not set or is erroneously set to avalue outside the range, then the angle of rotation θ is set equal to0°, in step S387, and the routine ends.

[0259] As described above, the stepping motor 26 is driven with a highernumber of pulses when the angle of rotation θ is low, than when theangle of rotation θ is high. Therefore, the control of the rotation ofthe light shield 25 can be optimized depending on the desired angle ofrotation θ.

[0260]FIG. 39 shows a table of the relationship between the change inthe brightness signal value Δy and the rotation angle θ of the steppingmotor 26, for each of the endoscopes A, B and C, according to a secondmodified control of the sixth embodiment. As shown in FIG. 39, thechange in brightness level Δy per degree of rotation of the light shield25, increases as the angle of rotation θ of the stepping motor 26increases. In this modified embodiment, the stepping motor 26 is rotatedby 0.5° when one drive pulse is applied. Further, the number of pulsesto be applied to the stepping motor 26 changes in accordance with theangle of rotation θ of the stepping motor 26.

[0261]FIG. 40 shows a flowchart of the subroutine according to thesecond modified control of the sixth embodiment, called in step S265 ofthe interrupt routine, shown in FIG. 26.

[0262] Step S400 determines whether the brightness value is within theallowed brightness range (i.e., |RV−BV|>β). If the brightness value iswithin the allowed brightness range (S400:N), then the subroutine isended, and the interrupt routine is ended. Otherwise (S400:Y), step S401determines whether a type A endoscope is connected to the videoprocessor 20. If a type A endoscope is connected (S401:Y) and the angleof rotation θ is greater than θ₃, in step S402, then the stepping motor26 is driven with P7 pulses, in step S403, and the subroutine is ended.In this embodiment, P7=1, and θ₃=23°.

[0263] If the angle of rotation θ is less than θ₃ (S401:N), then thestepping motor 26 is driven with P8 pulses, in step S404, and thesubroutine is ended. In this embodiment, P8=2.

[0264] If a type A endoscope is not connected to the video processor 20(S401:N), then step S405 determines whether a type B endoscope isconnected. If a type B endoscope is connected (S405:Y) and the angle ofrotation θ is greater than θ₄, in step S406, then the stepping motor 26is driven with P9 pulses, in step S407, and the subroutine is ended. Inthis embodiment, P9=2, and θ₃=20°.

[0265] If the angle of rotation θ is less than θ₄ (S406:2), then thestepping motor 26 is driven with P10 pulses, in step S408, and thesubroutine is ended. In this embodiment, P10=3.

[0266] However, if a type C endoscope is connected, then the steppingmotor 26 is driven with P11 pulses, in step S409, for all angles ofrotation θ. In this embodiment, P11=4.

[0267] Thus, as described above, the number of pulses to be sent to themotor is determined in accordance with the type of endoscope and theangle of rotation of the light shield 25.

[0268] In the six embodiments described above, the light shield 25 isrotated by the stepping motor 26 in order to vary the amount of lightemitted by the lighting unit. Then, the brightness value BV of thereceived brightness signal is detected and a determination is made as towhether the light shield 25 should be adjusted. Therefore, the intervalat which the interrupt may be executed is limited by the mechanicalconstruction and stability of the light amount controlling device.

[0269] The seventh embodiment described below employs an electronicfeedback control of the light amount controlling device. Therefore, theinterval between successive interrupts can be shortened, and thus thelight amount controlling device can be adjusted more quickly.

Electronically Controlled Embodiment

[0270]FIGS. 41 and 42 are flowcharts illustrating the drive control ofthe stepping motor 26, according to the seventh embodiment. The drivecontrol of the stepping motor 26 is an interrupt procedure executed at apredetermined interval. In the seventh embodiment, the predeterminedinterval is 20 ms. The number of pulses applied to the stepping motor 26is either one or two.

[0271] In the seventh embodiment, four storage registers q1 through q4are used. As shown in FIG. 43, the register q1 is an eight-bit shiftregister with the least significant bit (i.e.,q1 _(L)) indicatingwhether the brightness value BV of the received image signal is greaterthan the reference value RV. If the brightness value BV is greater thanthe reference value RV, then q1 _(L) is set equal to 1, otherwise q1_(L) is set equal to 0.

[0272] When the subsequent interrupt procedure is executed, the value inthe q1 _(L) is shifted to the next highest order bit (i.e., shifted tothe left). The received brightness value BV and the reference value RVare then compared as described above and q1 _(L) is set with theappropriate value. Thus, the register q1 stores the result of thecomparison of the brightness value BV and the reference value RV, foreight consecutive interrupts. Further, the data of the most significantbit of the variable will be lost when the register is shifted to theleft.

[0273] The register q2 is also an eight-bit register with the leastsignificant bit q²L indicating whether the stepping motor 26 has beenrotated in a forward or reverse direction during the currently executedinterrupt procedure. If the stepping motor 26 is rotated in the forwarddirection, then q²L is set to 0, otherwise q²L is set to 1. When thestepping motor 26 is not driven, q2L is set to 0.

[0274] When the subsequent interrupt procedure is executed, the value inthe q²L is shifted to the next highest order bit (i.e., shifted to theleft). Thus, the register q2 stores the value indicating the directionof rotation of the stepping motor 26, for eight consecutive interrupts.Further, the data of the most significant bit of the variable will belost when the register is shifted to the left.

[0275] The register q3 is a one-bit register variable representingwhether the light shield 25 is in the hunting condition. The register q3is set to 0 if the light shield 25 is being normally driven. If thelight shield 25 is in the hunting condition, then the register q3 is setto 1.

[0276] The register q4 is used to indicate the direction of rotation ofthe stepping motor 26 during the last interrupt procedure. If thestepping motor 26 was driven in the forward direction, then q4 will beset to 0, otherwise (i.e., for the reverse direction) q4 is set to 1.

[0277] As shown in FIGS. 41 and 42, the brightness signal is received,in step S410. In step S411, the brightness value BV and reference valueRV are determined. Step S412 then checks the value of the register q3,to determine whether hunting is occurring.

[0278] If q3 is equal to Q, then hunting is occurring. In thisembodiment Q is equal to 1 . If hunting is occurring (i.e., q3 =1,S412:Y), step S418 determines whether the absolute value of thedifference between the reference value RV and the brightness value BV isgreater than a predetermined value PV (e.g., 8). If |RV−BV|>PV, then q3is set to 0, in step S419, and the interrupt procedure is terminated.Otherwise (S418:N), the interruption procedure is terminated. Therefore,the light shield 25 is not driven during the current interrupt, however,by setting q3 equal to 0, it is possible to drive the light shield 25during the next interrupt, even if hunting is currently occurring.

[0279] If hunting is not occurring (i.e., q3=0, S412:N), step S413determines whether the brightness value BV is greater than the referencevalue RV. If the brightness value BV is greater than the reference valueRV (S413:Y), then q¹L and q²L are set to 0, in step S414, and theforward rotation instruction signal is sent to the stepping motor 26, instep S415. However, if the brightness value BV is not greater than thereference value RV (S413:N), then q1 _(L) and q2 _(L) are set to 1, instep S416, and the reverse rotation instruction signal is sent to thestepping motor 26, in step S417. The forward or reverse instructionsignals are signals for determining the rotation direction of thestepping motor 26. The stepping motor 26 is not rotated in steps S415 orS417, but is rotated when it receives a motor driving pulse.

[0280] Next, in step S420 each bit of the registers q1 and q2 ischecked. If at least one of the registers q1 or q2 has the bits of itsregister alternating between “1” and “0”, then step S421 determines thathunting is occurring. Further, this decision may be made by checkingonly one of the registers q1 or q2.

[0281] If it is determined that hunting is not occurring, controlproceeds to step S423, otherwise all of the bits of the registers q1 andq2 are set to 0, and the register q3 is set to 1, in step S422.

[0282] Step S423 determines whether the brightness value BV is in theallowed brightness range (i.e., |RV−BV|>β, β having a value of 3 forexample), where RV±β is the allowed brightness range. If |RV−BV|>β(S423:N), then step S428 sets q²L equal to 0, and the routine is ended.Otherwise (S423:Y), step S424 determines whether q²L is equal to 0. Ifq²L is equal to 0 (S424:Y), then q4 is set equal to 0, in step S425.Otherwise (S424:N), q4 is set equal to 1, in step S426.

[0283] Then in S427 a driving pulse is sent to the stepping motor 26,and the routine ends.

[0284] As described above, in the seventh embodiment, by examining theregisters q1 and/or q2 the occurrence of hunting can be determined.Therefore, since the examination of the registers q1, q2 is doneelectronically the determination as to whether hunting is occurring canbe made quickly.

[0285] Further, as described above, when hunting is occurring, no pulsesare sent to the stepping motor 26, and thus the stepping motor 26 is notnormally driven. However, if the difference in brightness (|BV−RV|) isgreater than the predetermined value PV, the value of q3 is set to 0,and the stepping motor 26 can be driven during the next interruptprocedure. This reduces the amount of time required to rotate the lightshield 25.

[0286]FIG. 44 shows a flowchart of the drive control procedure of thestepping motor 26 according to a modification of the seventh embodimentof the present invention. The modified seventh embodiment is similar tothe seventh embodiment described above, except that the processing stepsof S440 through S446 are performed before the interrupt procedure shownin FIGS. 41 and 42 is executed.

[0287] Step S440 receives the image signal from the image processingcircuit 21. Then step 441 determines the brightness value BV of theimage signal and the reference value RV. Step S442 determines whetherthe value of the register q4 is equal to 0. If q4 is equal to 0, thenthe motor was rotated in the forward direction, and control proceeds tostep S444, which determines whether the brightness value BV hasdecreased. If the brightness value BV has decreased (S444:Y), thencontrol proceeds to step S446. Otherwise (S444:N), control proceeds tostep S445 which determines whether the difference between the brightnessvalue BV and the reference value RV is greater than the predeterminedvalue PV. If |RV−PV|>BV (S445:Y), then control proceeds to step S446.Otherwise (S445:N), the routine is terminated.

[0288] In the case that q4 is not equal to 0 (S442:N), step S443determines whether the brightness value BV has increased. If thebrightness value BV has increased (S443:Y), then control proceeds tostep S446. Otherwise (S443:N), step S445 determines whether thedifference between the brightness value BV and the reference value RV isgreater than the predetermined value PV (PV being 10, for example). If|RV−BV|>PV (S445:Y), then control proceeds to step S446. Otherwise,(S445:N), the routine is terminated.

[0289] At step S446, steps S412 through S424 of the flowchart of FIGS.41 and 42, are performed.

[0290] According to the modification of the seventh embodiment, when thebrightness value BV does not change after the stepping motor 26 hasrotated the light shield 25 (e.g. as a result of mechanical delay inrotating the light shield 25), if the difference between the brightnessvalue BV and the reference value RV is greater than the predeterminedvalue PV, the motor drive signal is sent to the driving circuit 28. Thisreduces the amount of time required to rotate the light shield 25, inthe cases that the difference in brightness (|BV−RV|) is greater thanthe predetermined value PV.

[0291] If the difference (|BV−RV|) is not greater than the predeterminedvalue PV, the motor drive signal is not sent to the driving circuit 28.

[0292] In the modified seventh embodiment, the register q4 is employedto easily determine the direction that the motor was driven during theprevious interrupt. However, by examining q2 _(L) in step S442 the sameresult can be achieved.

[0293]FIGS. 41 and 45 show a flowchart of a drive control procedure ofthe stepping motor 26, according to an eighth embodiment of the presentinvention. The eighth embodiment is similar to the seventh embodimentdescribed above. However, in the eighth embodiment, the interval betweensuccessive interrupts is 50 ms. Further, the register q3 is a two bitregister. If the light shield 25 is driven normally, q3 has the value 0.If hunting occurs, and the number of motor drive pulses is high (i.e., 5through 10), then q3 is set equal to 1 . If hunting occurs, and thenumber of motor drive pulses is low (i.e., 1 or 2), then q3 is set equalto 2.

[0294] Therefore, in the eighth embodiment the value of Q is 2, and stepS412 determines whether q3 is equal to 2. Further, the interval betweensuccessive interrupts is 50 ms: Furthermore, the number of pulsesapplied to the motor during an interrupt can be in the range of can bemade small or large.

[0295] In the eighth embodiment, after the patterns of the registers q1and q2 have been checked in step S420, if one of the registers q1, q2has an alternating pattern of “1”s and “0”s, then step S451 determinesthat hunting is occurring. If hunting is occurring (S451:Y), q1 and q2are set to 0, in step S452. Step S453 checks whether q3 is set equal to0. If q3 is set to 0 (S453:Y), then q3 is set equal to 1 in step S454.Otherwise (S453:N), q3 is set equal to 2 in step S455, and controlproceeds to step S456. If hunting is not occurring (S451:N), thencontrol proceeds to step S456.

[0296] Step S456 determines whether |BV−RV|>β, where RV±β is the allowedbrightness range. If the difference is within the allowed brightnessrange (S456:N), then the q2L is set equal to 0 in step S460, and theroutine is terminated.

[0297] If the difference is not within the allowed brightness range(S456:Y), then step S457 determines whether q2 _(L) is equal to 0. If q2_(L) is equal to 0 (S457:Y), then q4 is set equal to 0, in step S458.Otherwise (S458:N), q4 is set equal to 1, in step S459. Step S461determines whether q3 is equal to 0. If q3 is equal to 0 (S461:Y), then5 or more driving pulses are sent to the stepping motor 26 in step 5463,and the routine is terminated. Otherwise (S461:N), only one or twodriving pulses are sent to the stepping motor 26 inn step S462, and theroutine is terminated.

[0298] As described above, in the eighth embodiment, if the number ofdrive pulses sent to the stepping motor 26 is large, and hunting isoccurring, then in the next interrupt procedure the number of drivepulses is made smaller and the driving of the stepping motor 26 iscontinued. However, if the number of drive pulses sent to the steppingmotor 26 is small, and hunting is still occurring, then no drive pulsesare sent to the stepping motor 26.

[0299] Thus, with this control, the stepping motor 26 is initiallydriven with a large number of driving pulses in order to quickly rotatethe light shield 25. Then, if hunting occurs, the number of drive pulsesis reduced, and the motor driving is continued. Therefore, the lightshield 25 can be rotated with high speed and accuracy.

[0300]FIGS. 46A and 46B show a flowchart of the drive control procedureof the stepping motor 26 according to a modification of the eighthembodiment of the present invention. The modified eighth embodiment issimilar to the modified seventh embodiment shown in FIG. 44, anddescribed above.

[0301] As shown in FIG. 46A, the same steps S440 through S445, shown inFIG. 44, are executed. However, in step S443, if BV increased (S443:Y)then control proceeds to step S447. In step S447 the steps S412 throughS420 and S451 through S462, shown in FIGS. 41 and 45 are executed.Similarly, in step S444, if BV decreases, control also goes to stepS447. After step S447 is executed the interrupt procedure is terminated.Further, in step S445, if |BV−RV|>PV, then step S447 is executed.Otherwise (S445:N), control proceeds to step S448, where steps S412through S420 are performed. Then steps S451 through S462 as shown inFIG. 46B are executed. These steps are similar to the steps shown inFIG. 45. However, in the modified eighth embodiment, after q4 has beenset to 0 in step S458 or q4 has been set to 1 in step S459, step S462 isexecuted.

[0302] Therefore in the modified eighth embodiment, when the brightnessvalue BV does not change after the stepping motor 26 has rotated thelight shield 25 (e.g. as a result of mechanical delay in rotating thelight shield 25), if |BV−RV| is greater than the PV, a relatively largenumber of motor driving pulses is sent to the driving circuit 28.However, if |BV−RV| is not greater than PV, but is greater than β, arelatively small number of motor driving pulses is sent to the drivingcircuit 28. In this case, the value of q3 has no effect on the number ofdriving pulses sent to the motor.

[0303] In the eight embodiments described above, a single light shield25 was employed in order to vary the amount of light emitted by thelighting unit. In the ninth embodiment described below, two lightshields are employed.

Two Light Shield Embodiment

[0304]FIG. 47 shows a schematic diagram of the construction of theendoscope according to the ninth embodiment of the present invention.The construction of ninth embodiment is similar to the construction ofthe first embodiment shown in FIG. 1, with the common elements havingthe same reference numbers.

[0305] As shown in FIG. 47, the video processor 120 has the light shield25 arranged to be rotated by the stepping motor 26 along a verticalaxis, in a similar manner to the first embodiment. The video processor120 further includes a light shield 125 arranged to be rotated by astepping motor 126 along a horizontal axis. The light shield 25 ispositioned between the lamp 22 and the light shield 125. The motorcontrol circuit 28 controls the operation of the stepping motor 25 andthe stepping motor 125. Information related to an operation of theendoscope 1 is input using the switch panel 201.

[0306]FIG. 48 shows a perspective view of the light shields 25 and 125.The light shields 25, 125 have a U-shape, and are rotated about thevertical and horizontal axes, respectively, by the stepping motors 26and 126. Further, the light shields 25, 125 have the same size.

[0307] The light shield 25 varies the size of the light path L in thehorizontal direction, while the light shield 125 varies the size of thelight path L in the vertical direction. Thus, the amount of light whichenters the optical fiber 4 can be controlled quickly and accurately.

[0308] The brightness level can be selected from amongst ten levels 1through 10, using the switch panel 201. The selected brightness level isread by a microprocessor 130, that determines which of the light shields25, 125 is to be rotated. Further, the direction of rotation and amountof rotation of the selected light shield is also determined by themicroprocessor 130.

[0309]FIG. 49 is a block diagram illustrating the controller 130. Asshown in FIG. 49, the microprocessor 130 includes an operation controlcircuit 131, a direction control circuit 132 and a motor selectioncircuit 133. The operation control circuit 131 receives a brightnessvalue from the switch panel 201. Further, the integrated output of theCCD 3 is output from the integration circuit 109 to the operationcontrol circuit 131. The operation control circuit 131 compares thebrightness of the integrated CCD signal with a reference brightnesslevel corresponding to the brightness level input from switch panel 201.

[0310] Based on the comparison of the two signals, the operation controlcircuit 131 controls the direction control circuit 132 to output aforward or reverse drive signal to the motor control circuit 28.Further, the operation control circuit 131 controls the motor selectioncircuit 133 to output a motor select signal to the motor control circuit28. The motor control circuit 28 controls the operation of the motors 26and 126 in accordance with the signals received from the directioncontrol circuit 132 and the motor selection circuit 133.

[0311] The operation control circuit 131, the direction control circuit132 and the motor selection circuit 133 may be implemented as discretehardware units. Alternatively, the functions of these blocks may beimplemented in software using a CPU, RAM, and a ROM etc.

[0312]FIG. 50 illustrates a flowchart of the drive control procedure ofthe stepping motors 26 and 126, according to the ninth embodiment. Inthis embodiment, the interrupt procedure is executed every 50 ms.

[0313] At step S500, the brightness signal is received from the CCD.Step S501 determines the brightness value BV and the reference value RV.Step S502 determines whether the difference between the receivedbrightness value BV and the reference value RV is greater than anallowed brightness range β. If |BV−RV| is not greater than β (S502:N),then the routine is terminated. Otherwise (S502:Y), control proceeds tostep S503 which determines whether |BV−RV| is greater than anotherallowed brightness range β₁, where β₁ is greater than β. If |BV−RV| isgreater than β₁ (S503:Y), then the motor selection circuit 133 selectsboth stepping motors 26, 126 to be driven by the motor control circuit28, in step S504. Otherwise (S503:N), the motor selection circuit 133selects only stepping motor 126, to be driven by the motor controlcircuit 28, in step S504.

[0314] After the motor to be driven has been selected, step S507determines whether the brightness value BV is greater than the referencevalue RV. If the brightness value BV is greater than the reference valueRV (S507:Y), then the forward pulse is sent to the stepping motor(s) 26,126 in step S508. Otherwise (S507:N), the reverse pulse is sent to thestepping motor(s) 26, 126 in step S509. Then a predetermined number ofpulses is sent to the stepping motor(s), in step S510, and the routineis ended.

[0315] As described above, if the difference between the brightnessvalue and the reference value is larger than the allowed brightnessrange β₁, then both stepping motors 26, 126 are driven to adjust theamount of light emitted by the lighting unit. Therefore, the amount oflight can be adjusted quickly and accurately. Further, by using twolight shields 25, 125, the amount of light can be adjusted quickly,while at the same time the number of pulses sent to the stepping motors26, 126 can be kept low. Thus, the hunting problem can be avoided.

[0316]FIG. 51 shows a modification of the ninth embodiment. In thismodification, the light shield 25 a is designed such that the length ofside B is longer than the length A of the corresponding side of thelight shield 125. With this construction, when the light shield 25 a isrotated, the change in the amount of light is greater than when thelight shield 125 is rotated.

[0317]FIG. 52 illustrates a flowchart of the drive control procedure ofthe stepping motors 26 and 126, according to the modified ninthembodiment. This is similar to the flowchart shown in FIG. 50 with stepsS500 through S510 being executed. However, at step S503, if |BV−RV|>β₁,then step S506 is executed instead of step S504. In step S506, only themotor 26 is selected to be driven by the motor control circuit 28.

[0318] Thus, as described above, if the difference between thebrightness value and the reference value is larger than the allowedbrightness range β₁, then the stepping motor 26 is driven to adjust theamount of light. Therefore, the amount of light can be adjusted quicklyand accurately, since rotation of the light shield 25 a has a greatereffect on the change in the amount of light than the rotation of thelight shield 125. Further, by using two light shields 25 a, 125, eachone having a different effect on the amount of light, the amount oflight can be adjusted quickly, while at the same time ensuring that thenumber of pulses sent to the stepping motors 26, 126 can be kept low.Thus, the hunting problem can be avoided.

[0319] The present disclosure relates to subject matter contained inJapanese Patent Application Nos. HEI 6-185832 filed on Aug. 8, 1994; HEI6-196362 filed on Aug. 22, 1994; HEI 6-196363 filed on Aug. 22, 1994;HEI 6-196364 filed on Aug. 22, 1994; HEI 6-196365 filed on Aug. 22,1994; HEI 6-200682 filed on Aug. 25, 1994; and HEI 6-303164 filed onAug. 29, 1994; which are expressly rated herein by reference in itsentirety.

What is claimed is:
 1. A device for controlling an amount of light of a lighting unit for use in an endoscope, said endoscope being used to view an image of an object, said device comprising: a light shielding system that shields light generated by a light source and transmitted to said endoscope; a stepping motor that drives said light shielding system for a plurality of predetermined time intervals; a system that detects a brightness of said image during each of said plurality of predetermined time intervals; an input system that inputs one of a plurality of desired brightnesses of said image; a generating system that generates a predetermined number of pulses during each of said plurality of predetermined time intervals, said predetermined number of pulses being transmitted to said stepping motor; a system that determines an angular position of said light shielding system; a setting system that sets one of a plurality of allowed brightness ranges of said image in response to said determined angular position of said light shielding system; and a system that determines whether said detected brightness is within the set one of said plurality of allowed brightness ranges.
 2. The device according to claim 1 , further comprising a control system that controls said stepping motor to drive said light shielding system in response to said detected brightness of said image being outside the set one of said plurality of allowed brightness ranges of said image.
 3. The device according to claim 1 , further comprising a system that determines a type of said endoscope, wherein said setting system sets said one of said plurality of allowed brightness ranges in response to said determined type of said endoscope.
 4. A device for controlling an amount of light of a lighting unit for use in an endoscope, said endoscope being used to view an image of an object, said device comprising: a light shielding system that shields light generated by a light source and transmitted to said endoscope; a stepping motor that drives said light shielding system for a plurality of predetermined time intervals; a system that detects a brightness of said image during each of said plurality of predetermined time intervals; an input system that inputs one of a plurality of desired brightnesses of said image; a generating system that generates a predetermined number of pulses during each of said plurality of predetermined time intervals, said predetermined number of pulses being transmitted to said stepping motor; a system that determines a type of said endoscope; a setting system that sets one of a plurality of allowed brightness ranges of said image in response to said determined type of said endoscope; and a system that determines whether said detected brightness is within the set one of said plurality of allowed brightness ranges.
 5. The device according to claim 4 , further comprising a control system that controls said stepping motor to drive said light shielding system in response to said detected brightness of said image being outside the set one of said plurality of allowed brightness ranges of said image.
 6. An aperture control device of a light source device for an endoscope, comprising: movable aperture member that shields a predetermined amount of light between a lamp and a light incident surface of a light guide; a device that cyclically detects a brightness of an observed image formed by the light; a stepping motor that drives said aperture member; a control device that supplies driving pulses to said stepping motor such that if, at each detection, the detected brightness differs from a reference brightness value by an amount greater than a predetermined amount, the control device provides driving pulses to the stepping motor for changing a position of the aperture member so that the brightness of the observed image approaches the reference brightness value; a system that determines an angular position of said movable aperture member; and a reference value setting device that sets the reference brightness value in response to a determined angular position of said movable aperture member.
 7. The aperture control device according to claim 6 , further comprising a device that determines a type of endoscope, wherein the reference value setting device sets an allowed brightness range in response to a determination of endoscope type.
 8. An aperture control device of a light source device for an endoscope, comprising: a movable aperture member that shields a predetermined amount of light between a lamp and a light incident surface of a light guide; a device that cyclically detects a brightness of an observed image formed by the light; a stepping motor that drives said aperture member; a control device that supplies driving pulses to said stepping motor such that if, at each detection, the detected brightness differs from a reference brightness value by an amount greater than a predetermined amount, the control device provides driving pulses to the stepping motor for changing a position of the aperture member so that the brightness of the observing image approaches the reference brightness value; a system that determines a type of endoscope; and a reference value setting device that sets the reference brightness value in response to a determination of endoscope type.
 9. The aperture control device according to claim 8 , further comprising a system that determines an angular position of said movable aperture member, wherein said reference value setting device sets an allowed brightness range in response to a determined angular position of said movable aperture member. 